<template>
    <div>
        <h3><center>请选择一级科室</center></h3>
        <div  style="float: left;margin-left: 27px" v-for="item in data" :key="item.id">
            <router-link :to="{name:'ChooseDepartment',params:{id:item.id}}"><div style="width: 200px;height: 150px;border: 2px solid #409EFF;margin-bottom: 50px;margin-left: 50px;
                border-radius: 2px;float: left;text-align: center;"><br>{{ item.name}}</div>
            </router-link>
        </div>
    </div>
</template>

<script>
    import axios from "axios";

    export default {
        name: "ChooseOneDepartment",
        data() {
            return{
                data:[{
                    id:'',
                    name:'',
                    children:[{

                    }]

                }],
                value: '',
            }

        },

        created(){
            this.create();
        },
        methods: {
            create() {
                axios.get("http://119.29.60.153:8001/doctorservice/department/getAllDepartments").then(resp => {
                    this.data = resp.data.data.list;
                })
            },
        }

    }
</script>

<style scoped>

</style>